package me.sealer.rmi.server.service.impl;

import me.sealer.rmi.api.DemoService;

import java.rmi.RemoteException;

/**
 * 这里用一句话描述这个类的作用
 *
 * @author sealer
 * @email 1178884049@qq.com
 * @date 2018年12月07日
 */
public class DemoServiceImpl implements DemoService {
    public static final String QUIT = "quit";
    @Override
    public String echo(String message) throws RemoteException {
        if (QUIT.equalsIgnoreCase(message)) {
            System.out.println("Server will be shutdown");
            System.exit(0);
        }
        String retMsg = "接收到的信息是： " + message;
        System.out.println(retMsg);
        return retMsg;
    }
}
